package com.baosight.sczx.zm.ca.service;

import java.util.Map;

import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.ep.ServiceEPBase;
import com.baosight.sczx.common.zm.Utils;
import com.baosight.sczx.zm.ca.domain.VZMCA03;

public class ServiceZMCA21  extends ServiceEPBase{

	/**
	 * 页面初始化，返回组织好的层级小代码
	 * 
	 * @param EiInfo
	 * @return EiInfo
	 */
	public EiInfo initLoad(EiInfo inInfo) {
		return inInfo;//return this.query(inInfo);
	}

	@SuppressWarnings("rawtypes")
	public EiInfo queryByTrend(EiInfo inInfo) {
		VZMCA03 daoBean = new VZMCA03();
		String sqlName = "ZMCA21.queryByTrend";
		EiBlock conBlock = inInfo.getBlock("inqu_status");
		Map r = conBlock.getRow(0);
		if(r.get("projectType").equals("钻孔计划"))
		{
			sqlName = "ZMCA21.queryByTrendHole";
		}
		inInfo.addBlock(Utils.generateOutBlock("result", daoBean, inInfo, sqlName, false));	
		return inInfo;
	}
	
	@SuppressWarnings("rawtypes")
	public EiInfo queryByDepartment(EiInfo inInfo) {
		VZMCA03 daoBean = new VZMCA03();
		String sqlName = "ZMCA21.queryByDepartment";
		EiBlock conBlock = inInfo.getBlock("inqu_status");
		Map r = conBlock.getRow(0);
		if(r.get("projectType").equals("钻孔计划"))
		{
			sqlName = "ZMCA21.queryByDepartmentHole";
		}
		inInfo.addBlock(Utils.generateOutBlock("result", daoBean, inInfo, sqlName, false));	
		return inInfo;
	}
	
	public EiInfo queryByProject(EiInfo inInfo) {
		VZMCA03 daoBean = new VZMCA03();
		inInfo.addBlock(Utils.generateOutBlock("result", daoBean, inInfo, "ZMCA21.queryByProject", false));	
		return inInfo;
	}
}
